#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"

void SLtest1(void)
{
	SeqList sl = { 0 };
	SeqListInit(&sl);
	SeqListPushBack(&sl, 1);
	SeqListPushBack(&sl, 2);
	SeqListPushBack(&sl, 3);
	SeqListPushBack(&sl, 4);
	SeqListPushBack(&sl, 5);
	SeqListPopBack(&sl);
	SeqListPopBack(&sl);
	SeqListPopBack(&sl);
	SeqListPopBack(&sl);
	SeqListPopBack(&sl);

	SeqListPrint(&sl);
}

void SLtest2(void)
{
	SeqList sl = { 0 };
	SeqListInit(&sl);
	SeqListPushFront(&sl, 6);
	SeqListPushFront(&sl, 5);
	SeqListPushFront(&sl, 4);
	SeqListPushFront(&sl, 3);
	SeqListPushFront(&sl, 2);
	SeqListPushFront(&sl, 1);
	SeqListPopFront(&sl);
	SeqListPopFront(&sl);
	SeqListPopFront(&sl);
	SeqListPopFront(&sl);
	SeqListPopFront(&sl);
	SeqListPopFront(&sl);
	SeqListPopFront(&sl);

	SeqListPrint(&sl);
	SeqListDestroy(&sl);
}

void SLtest3(void)
{
	SeqList sl = { 0 };
	SeqListInit(&sl);
	SeqListPushFront(&sl, 6);
	SeqListPushFront(&sl, 5);
	SeqListPushFront(&sl, 4);
	int i = SeqListFind(&sl, 4);
	SeqListInsert(&sl, i, 3);
	SeqListErase(&sl, i);
	i = SeqListFind(&sl, 5);
	SeqListErase(&sl, i);
	i = SeqListFind(&sl, 6);
	SeqListErase(&sl, i);
	i = SeqListFind(&sl, 4);
	SeqListErase(&sl, i);
	SeqListPrint(&sl);
	SeqListDestroy(&sl);
}

int main()
{
	/*SLtest1();*/
	//SLtest2();
	SLtest3();
	return 0;
}